package com.wangsong.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class MUserController {
	
	@RequestMapping(value="/name")
	@ResponseBody
	public String listUser(HttpServletRequest request,String name) {
		if(request.getSession().getAttribute(name)==null){
			request.getSession().setAttribute(name, name);
			return Thread.currentThread().getName()+"set:"+name;
		}else{
			return Thread.currentThread().getName()+"get:"+request.getSession().getAttribute(name);
		}
	}
	
	
}
